3.1100 \(\int \frac {(A+B x) (a+b x+c x^2)^p}{x^2} \, dx\)

Optimal. Leaf size=315 \[ \frac {2^{2 p-1} (a B+A b p) \left (\frac {-\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (\frac {\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p F_1\left (-2 p;-p,-p;1-2 p;-\frac {b-\sqrt {b^2-4 a c}}{2 c x},-\frac {b+\sqrt {b^2-4 a c}}{2 c x}\right )}{a p}-\frac {A c 2^{p+1} (2 p+1) \left (a+b x+c x^2\right )^{p+1} \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \, _2F_1\left (-p,p+1;p+2;\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{a (p+1) \sqrt {b^2-4 a c}}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{a x} \]

[Out]

-A*(c*x^2+b*x+a)^(1+p)/a/x-2^(1+p)*A*c*(1+2*p)*(c*x^2+b*x+a)^(1+p)*hypergeom([-p, 1+p],[2+p],1/2*(b+2*c*x+(-4*
a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))*((-b-2*c*x+(-4*a*c+b^2)^(1/2))/(-4*a*c+b^2)^(1/2))^(-1-p)/a/(1+p)/(-4*a*c+
b^2)^(1/2)+2^(-1+2*p)*(A*b*p+B*a)*(c*x^2+b*x+a)^p*AppellF1(-2*p,-p,-p,1-2*p,1/2*(-b-(-4*a*c+b^2)^(1/2))/c/x,1/
2*(-b+(-4*a*c+b^2)^(1/2))/c/x)/a/p/(((b+2*c*x-(-4*a*c+b^2)^(1/2))/c/x)^p)/(((b+2*c*x+(-4*a*c+b^2)^(1/2))/c/x)^
p)

________________________________________________________________________________________

Rubi [A]  time = 0.20, antiderivative size = 315, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {834, 843, 624, 758, 133} \[ \frac {2^{2 p-1} (a B+A b p) \left (\frac {-\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (\frac {\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p F_1\left (-2 p;-p,-p;1-2 p;-\frac {b-\sqrt {b^2-4 a c}}{2 c x},-\frac {b+\sqrt {b^2-4 a c}}{2 c x}\right )}{a p}-\frac {A c 2^{p+1} (2 p+1) \left (a+b x+c x^2\right )^{p+1} \left (-\frac {-\sqrt {b^2-4 a c}+b+2 c x}{\sqrt {b^2-4 a c}}\right )^{-p-1} \, _2F_1\left (-p,p+1;p+2;\frac {b+2 c x+\sqrt {b^2-4 a c}}{2 \sqrt {b^2-4 a c}}\right )}{a (p+1) \sqrt {b^2-4 a c}}-\frac {A \left (a+b x+c x^2\right )^{p+1}}{a x} \]

Antiderivative was successfully verified.

[In]

Int[((A + B*x)*(a + b*x + c*x^2)^p)/x^2,x]

[Out]

-((A*(a + b*x + c*x^2)^(1 + p))/(a*x)) + (2^(-1 + 2*p)*(a*B + A*b*p)*(a + b*x + c*x^2)^p*AppellF1[-2*p, -p, -p
, 1 - 2*p, -(b - Sqrt[b^2 - 4*a*c])/(2*c*x), -(b + Sqrt[b^2 - 4*a*c])/(2*c*x)])/(a*p*((b - Sqrt[b^2 - 4*a*c] +
 2*c*x)/(c*x))^p*((b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(c*x))^p) - (2^(1 + p)*A*c*(1 + 2*p)*(-((b - Sqrt[b^2 - 4*a*
c] + 2*c*x)/Sqrt[b^2 - 4*a*c]))^(-1 - p)*(a + b*x + c*x^2)^(1 + p)*Hypergeometric2F1[-p, 1 + p, 2 + p, (b + Sq
rt[b^2 - 4*a*c] + 2*c*x)/(2*Sqrt[b^2 - 4*a*c])])/(a*Sqrt[b^2 - 4*a*c]*(1 + p))

Rule 133

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[(c^n*e^p*(b*x)^(m +
 1)*AppellF1[m + 1, -n, -p, m + 2, -((d*x)/c), -((f*x)/e)])/(b*(m + 1)), x] /; FreeQ[{b, c, d, e, f, m, n, p},
 x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])

Rule 624

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, -Simp[((a + b*x + c*
x^2)^(p + 1)*Hypergeometric2F1[-p, p + 1, p + 2, (b + q + 2*c*x)/(2*q)])/(q*(p + 1)*((q - b - 2*c*x)/(2*q))^(p
 + 1)), x]] /; FreeQ[{a, b, c, p}, x] && NeQ[b^2 - 4*a*c, 0] &&  !IntegerQ[4*p]

Rule 758

Int[((d_.) + (e_.)*(x_))^(m_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c,
 2]}, -Dist[((1/(d + e*x))^(2*p)*(a + b*x + c*x^2)^p)/(e*((e*(b - q + 2*c*x))/(2*c*(d + e*x)))^p*((e*(b + q +
2*c*x))/(2*c*(d + e*x)))^p), Subst[Int[x^(-m - 2*(p + 1))*Simp[1 - (d - (e*(b - q))/(2*c))*x, x]^p*Simp[1 - (d
 - (e*(b + q))/(2*c))*x, x]^p, x], x, 1/(d + e*x)], x]] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b^2 - 4*a*c, 0]
 && NeQ[c*d^2 - b*d*e + a*e^2, 0] && NeQ[2*c*d - b*e, 0] &&  !IntegerQ[p] && ILtQ[m, 0]

Rule 834

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Sim
p[((e*f - d*g)*(d + e*x)^(m + 1)*(a + b*x + c*x^2)^(p + 1))/((m + 1)*(c*d^2 - b*d*e + a*e^2)), x] + Dist[1/((m
 + 1)*(c*d^2 - b*d*e + a*e^2)), Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p*Simp[(c*d*f - f*b*e + a*e*g)*(m + 1)
 + b*(d*g - e*f)*(p + 1) - c*(e*f - d*g)*(m + 2*p + 3)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p}, x] &&
NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && LtQ[m, -1] && (IntegerQ[m] || IntegerQ[p] || IntegersQ
[2*m, 2*p])

Rule 843

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Dis
t[g/e, Int[(d + e*x)^(m + 1)*(a + b*x + c*x^2)^p, x], x] + Dist[(e*f - d*g)/e, Int[(d + e*x)^m*(a + b*x + c*x^
2)^p, x], x] /; FreeQ[{a, b, c, d, e, f, g, m, p}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0]
&&  !IGtQ[m, 0]

Rubi steps

\begin {align*} \int \frac {(A+B x) \left (a+b x+c x^2\right )^p}{x^2} \, dx &=-\frac {A \left (a+b x+c x^2\right )^{1+p}}{a x}-\frac {\int \frac {(-a B-A b p-A c (1+2 p) x) \left (a+b x+c x^2\right )^p}{x} \, dx}{a}\\ &=-\frac {A \left (a+b x+c x^2\right )^{1+p}}{a x}+\frac {(A c (1+2 p)) \int \left (a+b x+c x^2\right )^p \, dx}{a}+\frac {(a B+A b p) \int \frac {\left (a+b x+c x^2\right )^p}{x} \, dx}{a}\\ &=-\frac {A \left (a+b x+c x^2\right )^{1+p}}{a x}-\frac {2^{1+p} A c (1+2 p) \left (-\frac {b-\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}\right )^{-1-p} \left (a+b x+c x^2\right )^{1+p} \, _2F_1\left (-p,1+p;2+p;\frac {b+\sqrt {b^2-4 a c}+2 c x}{2 \sqrt {b^2-4 a c}}\right )}{a \sqrt {b^2-4 a c} (1+p)}-\frac {\left (2^{2 p} (a B+A b p) \left (\frac {1}{x}\right )^{2 p} \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p\right ) \operatorname {Subst}\left (\int x^{1-2 (1+p)} \left (1+\frac {\left (b-\sqrt {b^2-4 a c}\right ) x}{2 c}\right )^p \left (1+\frac {\left (b+\sqrt {b^2-4 a c}\right ) x}{2 c}\right )^p \, dx,x,\frac {1}{x}\right )}{a}\\ &=-\frac {A \left (a+b x+c x^2\right )^{1+p}}{a x}+\frac {2^{-1+2 p} (a B+A b p) \left (\frac {b-\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} \left (\frac {b+\sqrt {b^2-4 a c}+2 c x}{c x}\right )^{-p} \left (a+b x+c x^2\right )^p F_1\left (-2 p;-p,-p;1-2 p;-\frac {b-\sqrt {b^2-4 a c}}{2 c x},-\frac {b+\sqrt {b^2-4 a c}}{2 c x}\right )}{a p}-\frac {2^{1+p} A c (1+2 p) \left (-\frac {b-\sqrt {b^2-4 a c}+2 c x}{\sqrt {b^2-4 a c}}\right )^{-1-p} \left (a+b x+c x^2\right )^{1+p} \, _2F_1\left (-p,1+p;2+p;\frac {b+\sqrt {b^2-4 a c}+2 c x}{2 \sqrt {b^2-4 a c}}\right )}{a \sqrt {b^2-4 a c} (1+p)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.24, size = 289, normalized size = 0.92 \[ \frac {\left (\frac {b-\sqrt {b^2-4 a c}}{2 c x}+1\right )^{-p} \left (\frac {b-\sqrt {b^2-4 a c}}{2 c}+x\right )^{-p} \left (\frac {-\sqrt {b^2-4 a c}+b+2 c x}{c}\right )^p \left (\frac {\sqrt {b^2-4 a c}+b+2 c x}{c x}\right )^{-p} (a+x (b+c x))^p \left (2 A p F_1\left (1-2 p;-p,-p;2-2 p;-\frac {b+\sqrt {b^2-4 a c}}{2 c x},\frac {\sqrt {b^2-4 a c}-b}{2 c x}\right )+B (2 p-1) x F_1\left (-2 p;-p,-p;1-2 p;-\frac {b+\sqrt {b^2-4 a c}}{2 c x},\frac {\sqrt {b^2-4 a c}-b}{2 c x}\right )\right )}{2 p (2 p-1) x} \]

Warning: Unable to verify antiderivative.

[In]

Integrate[((A + B*x)*(a + b*x + c*x^2)^p)/x^2,x]

[Out]

(((b - Sqrt[b^2 - 4*a*c] + 2*c*x)/c)^p*(a + x*(b + c*x))^p*(2*A*p*AppellF1[1 - 2*p, -p, -p, 2 - 2*p, -1/2*(b +
 Sqrt[b^2 - 4*a*c])/(c*x), (-b + Sqrt[b^2 - 4*a*c])/(2*c*x)] + B*(-1 + 2*p)*x*AppellF1[-2*p, -p, -p, 1 - 2*p,
-1/2*(b + Sqrt[b^2 - 4*a*c])/(c*x), (-b + Sqrt[b^2 - 4*a*c])/(2*c*x)]))/(2*p*(-1 + 2*p)*(1 + (b - Sqrt[b^2 - 4
*a*c])/(2*c*x))^p*x*((b - Sqrt[b^2 - 4*a*c])/(2*c) + x)^p*((b + Sqrt[b^2 - 4*a*c] + 2*c*x)/(c*x))^p)

________________________________________________________________________________________

fricas [F]  time = 0.92, size = 0, normalized size = 0.00 \[ {\rm integral}\left (\frac {{\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p}}{x^{2}}, x\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^p/x^2,x, algorithm="fricas")

[Out]

integral((B*x + A)*(c*x^2 + b*x + a)^p/x^2, x)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^p/x^2,x, algorithm="giac")

[Out]

integrate((B*x + A)*(c*x^2 + b*x + a)^p/x^2, x)

________________________________________________________________________________________

maple [F]  time = 1.29, size = 0, normalized size = 0.00 \[ \int \frac {\left (B x +A \right ) \left (c \,x^{2}+b x +a \right )^{p}}{x^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((B*x+A)*(c*x^2+b*x+a)^p/x^2,x)

[Out]

int((B*x+A)*(c*x^2+b*x+a)^p/x^2,x)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (B x + A\right )} {\left (c x^{2} + b x + a\right )}^{p}}{x^{2}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x^2+b*x+a)^p/x^2,x, algorithm="maxima")

[Out]

integrate((B*x + A)*(c*x^2 + b*x + a)^p/x^2, x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.00 \[ \int \frac {\left (A+B\,x\right )\,{\left (c\,x^2+b\,x+a\right )}^p}{x^2} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((A + B*x)*(a + b*x + c*x^2)^p)/x^2,x)

[Out]

int(((A + B*x)*(a + b*x + c*x^2)^p)/x^2, x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (A + B x\right ) \left (a + b x + c x^{2}\right )^{p}}{x^{2}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((B*x+A)*(c*x**2+b*x+a)**p/x**2,x)

[Out]

Integral((A + B*x)*(a + b*x + c*x**2)**p/x**2, x)

________________________________________________________________________________________